home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 461 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  974 b 

  1. Path: news.compuserve.com!newsmaster
  2. From: <75151.03563@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: re: What to use instead of strtok
  5. Date: 4 Jan 1996 18:08:45 GMT
  6. Organization: CompuServe Incorporated
  7. Message-ID: <4ch53d$he@dub-news-svc-3.compuserve.com>
  8. NNTP-Posting-Host: ad48-134.compuserve.com
  9. Content-Type: text/plain
  10. Content-length: 579
  11. X-Newsreader: AIR Mosaic (16-bit) version 3.10.08.25
  12.  
  13.  
  14. > In C I used strtok to parse a comma-delimited string.  What is the
  15. > best way for C++.  Comething with streams ?
  16.  
  17. I don't know about strings.  strtok() still works, but I would get a hold of
  18. a good String class that has member functions for doing this sort of
  19. thing.  If you are using MFC, the CString class has members for finding
  20. characters and substrings and performing the extractions.  If not, a little
  21. digging will probably net you a good class - or you could write your own
  22. class to enapsulate the parsing of the CSV string.
  23.  
  24. TomK
  25. 75151,03563@compuserve.com
  26.  
  27.